Basic usage of the SMPDF API


In [2]:
from smpdflib.core import *

Load a PDF and an APPLgrid


In [3]:
pdf = PDF("NNPDF30_nlo_as_0118")

In [8]:
obs = make_observable("data/higgs/ggh_13tev.root", order='NLO')

Convolve


In [12]:
r = produce_results([pdf], [obs])


Out[12]:
[<smpdflib.core.MCResult at 0x7f96cda4cd68>]

In [20]:
r.central_value


Out[20]:
0    27.393154
Name: 0, dtype: float64

In [21]:
r.std_error()


Out[21]:
0    0.497741
dtype: float64

All results


In [22]:
r._data


Out[22]:
0 1 2 3 4 5 6 7 8 9 ... 91 92 93 94 95 96 97 98 99 100
0 27.393154 25.507144 27.496468 27.509456 26.913122 24.877878 27.635526 27.574444 27.453919 27.524309 ... 26.902303 27.552121 27.329287 27.920003 27.358253 27.655792 27.371129 27.943288 27.894473 27.606984

1 rows × 101 columns


In [24]:
r.errorbar68


Out[24]:
max min
0 0.275119 -0.293731

Save and load from a database


In [42]:
import shelve

In [43]:
db = shelve.open('db/db')

In [ ]:
r1 = produce_results(pdf, obs, db=db)

Not computed again


In [ ]:
r2 = produce_results(pdf, obs, db=db)